<?php
class My_Model extends CI_Model
{
    private $_table;
    
    public function __construct($table='')
    {
        parent::__construct();
        $this->_table = $table;
    }
    
    public function get_by($field, $value)
	{
		$where = array($field => $value);

		return $this->get_where($this->_table,$where);
	}
	public function delete($id) { 

        if (is_numeric($id)) { 
            $this->db->where($this->key, $id); 
        } elseif (is_array($id)) { 
            $this->db->where_in($this->key, $id); 
        } 
         
        return $this->db->delete($this->table); 
    } 
}
